package Game; //Modifique o pacote.

import Game.ManagerSound.Type;


public class ArkanoidBall extends GameObject
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public float speedx, speedy;

	public ArkanoidBall(float x, float y, int w, int h, float speedx, float speedy)
	{
		super(x, y, w, h);
		Load("/Imagens/ball.png");
		this.speedx = speedx;
		this.speedy = speedy;
	}
	
	public void Update()
	{
        this.x += this.speedx;
        this.y += this.speedy;


        if (this.x < 0 || this.x > 800 - this.w)
        {
            this.speedx *= -1;
            ManagerSound.getIntance().Play(Type.COLLISION);
        }

        if (this.y < 0 || this.y > 600 - this.h)
        {
            this.speedy *= -1;
            ManagerSound.getIntance().Play(Type.COLLISION);
        }
    }
}
